import os

import pytest

from manage import app

# flake8: noqa


@pytest.fixture
def client():

    app.config["TESTING"] = True
    app.config["DEBUG"] = True

    with app.test_client() as client:
        with app.app_context():
            # 初始化数据库
            # 初始化数据？
            # app.init_db()
            ...
        yield client

    os.close(db_fd)
    os.unlink(flaskr.app.config["DATABASE"])


@pytest.fixture(scope="session", autouse=True)
def faker_session_locale():
    return ["zh_CN"]
